import http from '@/utils/request'

// 将商品加入购物车
export const addCartGoods = (goodsId, goodsNum, goodsSkuId) => {
  return http.post('/cart/add', {
    goodsId, goodsNum, goodsSkuId
  })
}

// 获取购物车列表
export const getCartList = () => {
  return http.get('/cart/list')
}

// 商品数量更改
export const updateCartGoods = (goodsId, goodsNum, goodsSkuId) => {
  return http.post('/cart/update', { goodsId, goodsNum, goodsSkuId })
}

// 删除购物车选中的商品
export const sleDel = (cartIds) => {
  return http.post('/cart/clear', { cartIds })
}
